package wechat.app

import org.junit.Ignore
import org.junit.Test
import wechat.base.snd.WCMenu
import wechat.base.snd.WCSubButton

class CreateCorpMenuTest{

//	@Test
//	@Ignore
//	def void deletemenu(){
//		WXCorpAppFactory::getDefaultCorpApp()=>[
//			deleteMenu
//		]
//	}
	
	@Test
	@Ignore
	def void createMenu(){
		val app = WXCorpAppFactory::getDefaultCorpApp()
		val m =  new WCMenu=>[
			withButton(
				createBtn=>[
					name = '查询工单'
					type = 'click'
					key = 'WORKORDER_LIST'
//					withSubButton(new WCSubButton=>[
////						type = 'view'
//						type = 'click'
//						name ='我的通知'
////						url = app.buildAuthConnection("http://210.22.183.30:8090/mylist","101")
//						key = 'NOTIFICATION_LIST'
//					])
				]
			)
//			withButton(
//				createBtn=>[
//					name = '通知列表'
//					withSubButton(new WCSubButton=>[
//						type = 'view'
//						name ='test'
//						url = app.buildAuthConnection("http://210.22.183.30:8090/test","2")
//					])
//					withSubButton(new WCSubButton=>[
//						type = 'view'
//						name ='TSC立项通知'
//						url = "http://www.baidu.com"
//					])
//				]
//			)
		]
		
		println(m.build.toString)
		println('******************************'+app.createMenu(m))
	}
	
	@Test
	@Ignore	
	def void testGetMenuInfo(){
//		WXCorpAppFactory::getDefaultCorpApp()=>[
//			println(getMenuInfo())
//		]
	}
}
